//
//  SsDetailVC.m
//  Project
//
//  Created by 冯东辉 on 2018/9/28.
//  Copyright © 2018年 FengDongHui. All rights reserved.
//

#import "SsDetailVC.h"

@interface SsDetailVC ()

@property (nonatomic, strong) UIWebView *webView;

@end

@implementation SsDetailVC

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.navTitleL.text = _moduleName;
    [self setFontSizeThatFits:self.navTitleL];
    [self createBlueNavigationBar:YES];
    
    [self creatWebView];
}

- (void)didReceiveMemoryWarning {
    
    [super didReceiveMemoryWarning];
}

- (void)creatWebView {
    
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, SafeAreaTopHeight, GET_SCREEN_WIDTH(), GET_SCREEN_HEIGHT()-SafeAreaTopHeight)];
    
    self.webView.backgroundColor = UICOLOR_HEX(0xffEDEEEF);
    
    self.webView.scalesPageToFit = YES;
    
    NSString * path = [[NSBundle mainBundle] pathForResource:@"/assets/hunan/html/shishizhuizong.html" ofType:nil];
    
    NSString *component = [NSString stringWithFormat:@"%@?cityName=%@&s_id=%@", path, _cityName, _s_id];
    
    NSString *encodedComponent = [component stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    
    NSURL *fileUrl = [[NSURL alloc] initWithString:encodedComponent];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:fileUrl];
    
    [self.webView loadRequest:request];
    
    [self.view addSubview:self.webView];
}

@end
